package com.example.administrator.yuejian_15.activity;

import android.app.Activity;
import android.content.Intent;
import android.os.Bundle;
import android.view.animation.AlphaAnimation;
import android.view.animation.Animation;
import android.widget.ImageView;

import com.example.administrator.yuejian_15.R;


public class FirstActivity extends Activity {
    ImageView iv_splan;
    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_first);

        iv_splan = (ImageView)findViewById(R.id.iv_splan);
        setAlphaAnimation();
    }

    private void setAlphaAnimation() {
        AlphaAnimation alpha = new AlphaAnimation(0,1);
        alpha.setDuration(3000);
        alpha.setFillAfter(true);
        alpha.setAnimationListener(new Animation.AnimationListener() {
            @Override
            public void onAnimationStart(Animation animation) {

            }

            @Override
            public void onAnimationEnd(Animation animation) {
                Intent intent =  new Intent(FirstActivity.this,LoginActivity.class);
                startActivity(intent);
                finish();

            }

            @Override
            public void onAnimationRepeat(Animation animation) {

            }
        });
        iv_splan.setAnimation(alpha);
    }

}
